import Types from '../actionTypes';

let initState = {
  token: localStorage.getItem('token') || 0
};

export default (state = initState, action) => {
  const newState = JSON.parse(JSON.stringify(state));
  switch (action.type) {
    case Types.GET_LOGIN:
      newState.token = action.value;
      return newState;
    default:
      console.log('Types no match in Login.js ....');
  }
  return state;
}
